<template>
  <micro-app
    v-if="isShowPage"
    class="micro-app"
    name="form-design-publicField"
    :url="appUrlconfig.formDesign"
    baseroute="/form-design"
    default-page="/sys/system"
    router-mode="native"
    :data="{ token: getToken(), sysConfig }"
    @error="onError"
  />
  <ErrorPage v-else :code="500"></ErrorPage>
</template>

<script setup lang="ts">
import { ref } from "vue";
import appUrlconfig from "@/config/appUrlconfig";
import { getToken } from "@/utils/auth";
import ErrorPage from "@/views/error/components/ErrorPage.vue";

const isShowPage = ref(true);
const onError = () => {
  isShowPage.value = false;
};

const sysConfig = ref({
  component: "common-fields"
});
</script>

<style scoped lang="scss">
.micro-app,
:deep(micro-app-body) {
  height: calc(100% - 40px);
  overflow-y: auto;
}
</style>
